﻿///http://www.w3schools.com/jsref/dom_obj_document.asp

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Html.HtmlTags;
using System.Html.HtmlElements;

namespace System.Html.Javascript.DOM {
    public class Document {

        #region Document Object Collections
        /// <summary>
        /// Returns an array of all the anchors in the document
        /// </summary>
        public A[] anchors {
            get {
                throw new NotImplementedException();
            }
        }
        /// <summary>
        /// Returns an array of all the forms in the document
        /// </summary>
        public FORM[] forms {
            get {
                throw new NotImplementedException();
            }
        }
        /// <summary>
        /// Returns an array of all the images in the document
        /// </summary>
        public IMG[] images {
            get {
                throw new NotImplementedException();
            }
        }
        /// <summary>
        /// Returns an array of all the links in the document
        /// </summary>
        public Tag[] links {
            get {
                throw new NotImplementedException();
            }
        }
        #endregion

        #region Document Object Properties
        /// <summary>
        /// Returns all name/value pairs of cookies in the document
        /// </summary>
        public KeyValuePair<string, string> cookie {
            get {
                throw new NotImplementedException();
            }
        }
        /// <summary>
        ///[NonStandard] 
        ///The documentMode property returns the mode used by the browser to render the current document.
        ///IE8 can render a page in different modes, depending on the !DOCTYPE or the presence of certain HTML elements.
        ///This property returns one of three values:
        ///    * 5 - The page is displayed in IE5 mode
        ///    * 7 - The page is displayed in IE7 mode
        ///    * 8 - The page is displayed in IE8 mode
        /// </summary>
        public int documentMode {
            get {
                throw new NotImplementedException();
            }
        }
        /// <summary>
        /// Returns the domain name of the server that loaded the document
        /// </summary>
        public string domain {
            get {
                throw new NotImplementedException();
            }
        }
        /// <summary>
        /// [NonStandard]
        /// Returns the date and time the document was last modified
        /// </summary>
        public DateTime lastModified {
            get {
                throw new NotImplementedException();
            }
        }
        /// <summary>
        /// [NonStandard]
        /// Returns the (loading) status of the document
        /// </summary>
        public DOCUMENT_READY_STATE readyState {
            get {
                throw new NotImplementedException();
            }
        }
        /// <summary>
        /// Returns the URL of the document that loaded the current document
        /// </summary>
        public string referrer {
            get {
                throw new NotImplementedException();
            }
        }
        /// <summary>
        /// Sets or returns the title of the document
        /// </summary>
        public string title {
            get {
                throw new NotImplementedException();
            }
            set {
                throw new NotImplementedException();
            }
        }
        /// <summary>
        /// Returns the full URL of the document
        /// </summary>
        public string URL {
            get {
                throw new NotImplementedException();
            }
        }
        #endregion
        #region Document Object Methods
        /// <summary>
        ///  Closes the output stream previously opened with document.open()
        /// </summary>
        public void close() {
            throw new NotImplementedException();
        }
        /// <summary>
        /// Accesses the first element with the specified id
        /// </summary>
        /// <param name="id">the name or id of the element that is being accessed</param>
        /// <returns>the html element</returns>
        public Tag getElementById(string id) {
            throw new NotImplementedException();
        }
        /// <summary>
        /// Accesses all elements with a specified name
        /// </summary>
        /// <param name="name">Name of the tag(s) to return</param>
        /// <returns>Array of tags of the specified name</returns>
        public Tag[] getElementsByName(string name) {
            throw new NotImplementedException();
        }
        /// <summary>
        /// Accesses all elements with a specified tagname
        /// </summary>
        /// <param name="tagName">Name of the tag type to return</param>
        /// <returns>Array of tags of the specified type</returns>
        public Tag[] getElementsByTagName(string tagName) {
            throw new NotImplementedException();
        }
        /// <summary>
        /// Opens an output stream to collect the output from document.write() or document.writeln()
        /// </summary>
        /// <param name="MIMEtype">Optional. The type of document you are writing to. Default value is "text/html"</param>
        /// <param name="replace">Optional. If set, the history entry for the new document inherits the history entry 
        /// from the document which opened this document</param>
        public void open(string MIMEtype, string replace) {
            throw new NotImplementedException();
        }
        /// <summary>
        /// Writes HTML expressions or JavaScript code to a document
        /// </summary>
        /// <param name="data">Optional. What to write to the output stream. Multiple arguments can be listed and 
        /// they will be appended to the document in order of occurrence</param>
        public void write(string[] data) {
            throw new NotImplementedException();
        }
        /// <summary>
        /// Same as write(), but adds a newline character after each statement
        /// </summary>
        /// <param name="data">array of strings to write to the document</param>
        public void writeln(string[] data) {
            string[] _data = new string[data.Length + 1];
            Array.Copy(data, _data, data.Length);
            _data[data.Length] = Environment.NewLine;
        }
        #endregion
    }

    /// <summary>
    /// The document.readyState property returns the (loading) status of the current document
    /// This property returns one of four values:
    ///     * uninitialized - Has not started loading yet
    ///     * loading - Is loading
    ///     * interactive - Has loaded enough and the user can interact with it
    ///     * complete - Fully loaded
    /// </summary>
    public enum DOCUMENT_READY_STATE {
        uninitialized, // Has not started loading yet
        loading, // Is loading
        interactive, // Has loaded enough and the user can interact with it
        complete // Fully loaded
    }
}